package com.inventory.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.ab.activity.AbActivity;
import com.inventory.R;
import com.inventory.global.MyApplication;

public class StockActivity extends AbActivity {
	
	private MyApplication application;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setAbContentView(mInflater.inflate(R.layout.stock, null));
        setTitleText(this.getResources().getString(R.string.dataStockBtn));
        setLogo(this.getResources().getDrawable(R.drawable.button_selector_logo));
        application = (MyApplication)abApplication;
        //Button queryAssignBtn = (Button)findViewById(R.id.queryAssignBtn);       
        Button queryTimeBtn = (Button)findViewById(R.id.queryTimeBtn);
        Button queryCheckBtn = (Button)findViewById(R.id.queryCheckBtn);
        /*queryAssignBtn.setOnClickListener(new View.OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(StockActivity.this,AssignQueryActivity.class); 
				startActivity(intent);
			}
        	
        });*/
        
        queryTimeBtn.setOnClickListener(new View.OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(StockActivity.this,TimeStockQueryActivity.class); 
				startActivity(intent);
			}
        	
        });
        
        queryCheckBtn.setOnClickListener(new View.OnClickListener(){

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(StockActivity.this,CheckQueryActivity.class); 
				startActivity(intent);
			}
        	
        });
        
        logoView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
        
    }
    
    
    private void initTitleRightLayout(){
    	clearRightView();
    	View rightViewMore = mInflater.inflate(R.layout.more_btn, null);
    	if(application.mUser != null){
    	    addRightView(rightViewMore);
    	}else{
    		addRightView(rightViewMore);
    	}
    	Button about = (Button)rightViewMore.findViewById(R.id.more_btn);
    	about.setOnClickListener(new View.OnClickListener(){

 			@Override
 			public void onClick(View v) {
 				Intent intent = new Intent(StockActivity.this,AboutActivity.class); 
 				startActivity(intent);
 			}
         	
         });
         
    }

	@Override
	protected void onResume() {
		super.onResume();
		//user_layout.removeAllViews();
		initTitleRightLayout();
	}
	
	public void onPause() {
		super.onPause();
	}
   
    

    
}


